<template>
  <div id="detail-comment" v-if="Object.keys(commentInfo).length !== 0">
    <div class="head">
      <div class="tile">用户评论</div>
      <div class="tile">更多 ></div>
    </div>
    <div class="comment-info">
      <div class="user">
        <img :src="commentInfo.user.avatar" alt="" class="head-img" />
        <div class="name">{{ commentInfo.user.uname }}</div>
      </div>
      <div class="content">{{ commentInfo.content }}</div>
      <div class="other">
        <span class="date">{{ commentInfo.created }}</span>
        <span class="category">{{ commentInfo.style }}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "DetailComment",
  props: {
    commentInfo: {
      type: Object,
    },
  },
};
</script>

<style scoped>
#detail-comment {
  padding: 10px 10px 30px 10px;
  font-size: 14px;
  border-bottom: solid 5px #f2f5f8;
}
.head {
  height: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: solid 1px rgba(9, 9, 9, 0.1);
}
.user {
  display: flex;
  align-items: center;
  margin-top: 10px;
}
.head-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 10px;
}
.name {
  font-size: 16px;
  color: #000;
}

.content {
  height: 40px;
  line-height: 1.5;
  margin: 10px 0;
}
.date {
  margin-right: 10px;
}
</style>